<ui:composition 
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:p="http://primefaces.org/ui"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:apks="http://java.sun.com/jsf/composite/apks"
    template="../usersTemplate.xhtml">
    <ui:define name="title">
        Aplikacije
    </ui:define>
    <ui:define name="center">
        <h:form>
            <h:outputLabel value="Pretraga:"/><p:autoComplete id="autocomplete" value="#{applicationManagedBean.searchText}" completeMethod="#{applicationManagedBean.complete}" maxResults="5"/><p:commandButton value="Prikazi" action="${applicationManagedBean.viewResult}" ajax="false"/>
            <p:dataGrid var="app" value="#{applicationManagedBean.af.findAll()}" columns="3"  
                        rows="9" paginator="true" effect="true"  
                        paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink}">  

                <p:column>  
                    <p:panel header="#{app.name}" style="text-align:center; width: 200px;">  
                        <h:panelGrid columns="1" style="width:90%">  
                            <p:graphicImage width="60" height="80" value="/imageservlet?appId=#{app.applicationId}&amp;image=1"/>   

                            <h:outputText value="Skinuta: #{app.downloads} puta" />
                        </h:panelGrid>  
                    </p:panel>  
                </p:column> 
            </p:dataGrid>
            <apks:applicationView application="#{applicationManagedBean.selectedApplication}"/>
        </h:form>
    </ui:define>
</ui:composition>